package io.gatling.extensions.mongodb.check

import io.gatling.core.check.DefaultFindCheckBuilder
import io.gatling.core.session._
import org.mongodb.scala.result._

trait MongoCheckType

object MatchedCountCheckBuilder extends DefaultFindCheckBuilder[MongoCheckType, UpdateResult, Long](
  extractor = MongoExtractors.matchedCountExtractor.expressionSuccess,
  displayActualValue = false
)

object ModifiedCountBuilder extends DefaultFindCheckBuilder[MongoCheckType, UpdateResult, Long](
  extractor = MongoExtractors.modifiedCountExtractor.expressionSuccess,
  displayActualValue = false
)

object InsertOneCheckBuilder extends DefaultFindCheckBuilder[MongoCheckType, InsertOneResult, Boolean](
  extractor = MongoExtractors.wasAcknowledgedOneExtractor.expressionSuccess,
  displayActualValue = false
)

object InsertManyCheckBuilder extends DefaultFindCheckBuilder[MongoCheckType, InsertManyResult, Boolean](
  extractor = MongoExtractors.wasAcknowledgedManyExtractor.expressionSuccess,
  displayActualValue = false
)

object DeleteCheckBuilder extends DefaultFindCheckBuilder[MongoCheckType, DeleteResult, Long](
  extractor = MongoExtractors.deletedCountExtractor.expressionSuccess,
  displayActualValue = false
)